package com.caul.demo.hadoop.mapreduce.attention;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * Created by sdliang on 2018/4/8.
 */
public class SecondAttentionMapper extends Mapper<LongWritable, Text, Text, Text> {

  private static Text textKey = new Text();
  private static Text valueKey = new Text();

  @Override
  protected void map(LongWritable key, Text value, Context context)
      throws IOException, InterruptedException {
    String[] users = value.toString().split("\t");
    textKey.set(users[0]);
    valueKey.set(users[1]);
    context.write(textKey, valueKey);
  }
}
